Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Generate JSON Schema consistency #4

Open
wants to merge 9 commits into
base: master
Choose a base branch
from

Conversation

charlypoly
Copy link
Contributor

@charlypoly charlypoly commented Apr 16, 2018

Pull request still in development

  • transform return a JSON Schema version draft-07
  • specs ensures that transform returns a valid JSON Schema using ajv lib
  • drop GRAPHQL_SCALAR, GRAPHQL_UNION and GRAPHQL_ENUM in generated strict schema

Copy link
Owner

@jakubfiala jakubfiala left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hey @wittydeveloper, thanks for the pull requests! I'm going to bundle this with your other PR in one release and give you a shout when it's published.

@charlypoly
Copy link
Contributor Author

Hi @jakubfiala , thanks!

However, please wait, this PR is not ready yet 🙏

@jakubfiala
Copy link
Owner

oh sure, not merging it yet :)

@charlypoly
Copy link
Contributor Author

Hi @jakubfiala,

After many work on the JSON-Schema standard compliance, I found that many things generated by the lib are "invalid" JSON-Schema properties.

I maintain a fork of this project with a partial fix.
I'm pretty sure that my changes will introduce breaking changes in the generation of the JSON Schema .

In order to ship a version fully compliant with the JSON Schema standard, I will need to refactor a lot of the code and i'm not sure if this changes make senses for the purpose of this repo?

I was thinking creating a different project that generate strictly valid JSON Schema (by ignoring not compatible GraphQL types, etc), what do you think?

Cheers,

@jakubfiala
Copy link
Owner

Hey @wittydeveloper – really sorry for only getting back to this after a few months, they've been very busy ones. I think what you're proposing makes sense, my approach was to represent as much as possible of the GSL at the cost of potential non-compliance with JSON Schema, while your approach is the other way around.

Thanks for your contributions to this project!

@charlypoly
Copy link
Contributor Author

@jakubfiala No problem!

Sorry on my side too, considering I needed a GraphQL to JSON Schema tool pretty quick and also another result (compliant), I started a new package:
https://github.com/wittydeveloper/graphql-to-json-schema

I didn't want to edit too many things in your library, and especially I prefer working with TypeScript 😅

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants